<?php
session_start();
define("MEMCACHE_HOST", "localhost");
define("MEMCACHE_PORT", "11211");

define("DAO_VOCLASS_PATH", "value");
require_once("pworks/common/dao/DaoFactory.class.php");
require_once("TokenHelper.class.php");

DBConfig::setTokenHelper(new TokenHelper());
DBConfig::setDBConfig("default", "10.50.71.51", "root", "123456", "test");
DBConfig::addSlaveDBConfig("default", "10.50.71.92", "root", "123456", "test");
//DBConfig::setDAOConfig('address', 'services.AddressDao');

$productsDao = DaoFactory::getDao("address");

//var_dump($productsDao);exit;
//$productList = $productsDao->fetchAll("1");
//var_dump($productList);

var_dump("11111111111111");

$productInfo = $productsDao->fetch("1");
$productInfo = $productsDao->fetch("1");
$productInfo = $productsDao->fetch("1");
$productInfo = $productsDao->fetch("1");

if (!$productInfo) {
    $productInfo = $productsDao->getEmptyValue();
    $productInfo->name = "1111";
}

//$sql = "SELECT * FROM `address` WHERE 1";
 //       $query = $productsDao->query($sql);
 //       $addressList = $query->fetchAll();
  //      var_dump($addressList);

$productInfo->save();

var_dump("222222222222222");

$productInfo = $productsDao->fetch("1");
$productInfo = $productsDao->fetch("1");
$productInfo = $productsDao->fetch("1");
$productInfo = $productsDao->fetch("1");
$productInfo = $productsDao->fetch("1");
$productInfo = $productsDao->fetch("1");


